- cargo publish --verbose --manifest-path sys/Cargo.toml --token $CRATES_IO_TOKEN
when: manual
-# libostree
-libostree:
+# ostree
+ostree:
stage: build
script:
- cargo test --verbose --all-features
-libostree_nightly:
+ostree_nightly:
stage: build
image: rustlang/rust:nightly
script:
- cargo test --verbose --all-features
allow_failure: true
-publish_libostree:
+publish_ostree:
stage: publish
script:
- cargo publish --verbose --token $CRATES_IO_TOKEN
[package]
-name = "libostree"
+name = "ostree"
version = "0.2.0"
authors = ["Felix Krull"]
description = "Rust bindings for libostree"
keywords = ["ostree", "libostree"]
-documentation = "https://fkrull.gitlab.io/ostree-rs/libostree"
+documentation = "https://fkrull.gitlab.io/ostree-rs/ostree"
repository = "https://gitlab.com/fkrull/ostree-rs"
readme = "README.md"
repository = "fkrull/ostree-rs"
[lib]
-name = "libostree"
+name = "ostree"
[dependencies]
libc = "0.2"
MIT License
-Copyright (c) 2018 Felix Krull
+Copyright (c) 2018, 2019 Felix Krull
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
-all: gir/libostree gir/ostree-sys
+all: gir/ostree gir/ostree-sys
.PHONY: update-gir-files
cargo install --root target/tools -- rustdoc-stripper
merge-lgpl-docs: target/tools/bin/gir target/tools/bin/rustdoc-stripper
- target/tools/bin/gir -c conf/libostree.toml -m doc
+ target/tools/bin/gir -c conf/ostree.toml -m doc
target/tools/bin/rustdoc-stripper -g -o target/vendor.md
+++ /dev/null
-[options]
-work_mode = "normal"
-library = "OSTree"
-version = "1.0"
-target_path = ".."
-doc_target_path = "../target/vendor.md"
-deprecate_by_min_version = true
-
-girs_dir = "../gir-files"
-
-generate = [
- "OSTree.AsyncProgress",
- "OSTree.GpgSignatureFormatFlags",
- "OSTree.GpgVerifyResult",
- "OSTree.ObjectType",
- "OSTree.Remote",
- "OSTree.RepoCheckoutMode",
- "OSTree.RepoCheckoutOverwriteMode",
- "OSTree.RepoCommitModifier",
- "OSTree.RepoCommitState",
- "OSTree.RepoDevInoCache",
- "OSTree.RepoMode",
- "OSTree.RepoPruneFlags",
- "OSTree.RepoPullFlags",
- "OSTree.RepoRemoteChange",
- "OSTree.RepoResolveRevExtFlags",
- "OSTree.RepoTransactionStats",
- "OSTree.SePolicy",
- "OSTree.SePolicyRestoreconFlags",
- "OSTree.StaticDeltaGenerateOpt",
- "OSTree.RepoListRefsExtFlags",
-
- #"OSTree.RepoPruneOptions",
- #"OSTree.RepoExportArchiveOptions",
- #"OSTree.RepoCheckoutOptions",
- #"OSTree.RepoCheckoutAtOptions",
-]
-
-manual = [
- "Gio.Cancellable",
- "Gio.File",
- "Gio.FileInfo",
- "Gio.FileQueryInfoFlags",
- "Gio.InputStream",
- "GLib.Bytes",
- "GLib.Error",
- "GLib.KeyFile",
- "GLib.String",
- "GLib.Variant",
-]
-
-[[object]]
-name = "OSTree.CollectionRef"
-status = "generate"
- [[object.function]]
- pattern = "dupv|equal|freev|hash"
- ignore = true
-
-[[object]]
-name = "OSTree.MutableTree"
-status = "generate"
- [[object.function]]
- pattern = "lookup"
- ignore = true
-
-[[object]]
-name = "OSTree.Repo"
-status = "generate"
- [[object.function]]
- pattern = ".+_async"
- ignore = true
-
- [[object.function]]
- pattern = "mode_from_string"
- ignore = true
-
- [[object.function]]
- pattern = "remote_gpg_import"
- ignore = true
-
-[[object]]
-name = "OSTree.RepoFile"
-status = "generate"
- [[object.function]]
- pattern = "get_xattrs"
- ignore = true
-
- [[object.function]]
- pattern = "tree_find_child"
- ignore = true
-
- [[object.function]]
- pattern = "tree_query_child"
- ignore = true
-
-[[object]]
-name = "OSTree.*"
-status = "generate"
- [[object.function]]
- pattern = "cmp_checksum_bytes|checksum_inplace_to_bytes"
- ignore = true
-
- [[object.constant]]
- pattern = "VERSION|VERSION_S|YEAR_VERSION|RELEASE_VERSION"
- ignore = true
--- /dev/null
+[options]
+work_mode = "normal"
+library = "OSTree"
+version = "1.0"
+target_path = ".."
+doc_target_path = "../target/vendor.md"
+deprecate_by_min_version = true
+
+girs_dir = "../gir-files"
+
+generate = [
+ "OSTree.AsyncProgress",
+ "OSTree.GpgSignatureFormatFlags",
+ "OSTree.GpgVerifyResult",
+ "OSTree.ObjectType",
+ "OSTree.Remote",
+ "OSTree.RepoCheckoutMode",
+ "OSTree.RepoCheckoutOverwriteMode",
+ "OSTree.RepoCommitModifier",
+ "OSTree.RepoCommitState",
+ "OSTree.RepoDevInoCache",
+ "OSTree.RepoMode",
+ "OSTree.RepoPruneFlags",
+ "OSTree.RepoPullFlags",
+ "OSTree.RepoRemoteChange",
+ "OSTree.RepoResolveRevExtFlags",
+ "OSTree.RepoTransactionStats",
+ "OSTree.SePolicy",
+ "OSTree.SePolicyRestoreconFlags",
+ "OSTree.StaticDeltaGenerateOpt",
+ "OSTree.RepoListRefsExtFlags",
+
+ #"OSTree.RepoPruneOptions",
+ #"OSTree.RepoExportArchiveOptions",
+ #"OSTree.RepoCheckoutOptions",
+ #"OSTree.RepoCheckoutAtOptions",
+]
+
+manual = [
+ "Gio.Cancellable",
+ "Gio.File",
+ "Gio.FileInfo",
+ "Gio.FileQueryInfoFlags",
+ "Gio.InputStream",
+ "GLib.Bytes",
+ "GLib.Error",
+ "GLib.KeyFile",
+ "GLib.String",
+ "GLib.Variant",
+]
+
+[[object]]
+name = "OSTree.CollectionRef"
+status = "generate"
+ [[object.function]]
+ pattern = "dupv|equal|freev|hash"
+ ignore = true
+
+[[object]]
+name = "OSTree.MutableTree"
+status = "generate"
+ [[object.function]]
+ pattern = "lookup"
+ ignore = true
+
+[[object]]
+name = "OSTree.Repo"
+status = "generate"
+ [[object.function]]
+ pattern = ".+_async"
+ ignore = true
+
+ [[object.function]]
+ pattern = "mode_from_string"
+ ignore = true
+
+ [[object.function]]
+ pattern = "remote_gpg_import"
+ ignore = true
+
+[[object]]
+name = "OSTree.RepoFile"
+status = "generate"
+ [[object.function]]
+ pattern = "get_xattrs"
+ ignore = true
+
+ [[object.function]]
+ pattern = "tree_find_child"
+ ignore = true
+
+ [[object.function]]
+ pattern = "tree_query_child"
+ ignore = true
+
+[[object]]
+name = "OSTree.*"
+status = "generate"
+ [[object.function]]
+ pattern = "cmp_checksum_bytes|checksum_inplace_to_bytes"
+ ignore = true
+
+ [[object.constant]]
+ pattern = "VERSION|VERSION_S|YEAR_VERSION|RELEASE_VERSION"
+ ignore = true
extern crate gio;
extern crate glib;
-extern crate libostree;
+extern crate ostree;
extern crate tempfile;
use glib::prelude::*;
-use libostree::prelude::*;
+use ostree::prelude::*;
use std::fs;
use std::io;
use std::io::Write;
-fn create_repo(repodir: &tempfile::TempDir) -> Result<libostree::Repo, glib::Error> {
- let repo = libostree::Repo::new_for_path(repodir.path());
- repo.create(libostree::RepoMode::Archive, None)?;
+fn create_repo(repodir: &tempfile::TempDir) -> Result<ostree::Repo, glib::Error> {
+ let repo = ostree::Repo::new_for_path(repodir.path());
+ repo.create(ostree::RepoMode::Archive, None)?;
Ok(repo)
}
fn create_mtree(
treedir: &tempfile::TempDir,
- repo: &libostree::Repo,
-) -> Result<libostree::MutableTree, glib::Error> {
+ repo: &ostree::Repo,
+) -> Result<ostree::MutableTree, glib::Error> {
let gfile = gio::File::new_for_path(treedir.path());
- let mtree = libostree::MutableTree::new();
+ let mtree = ostree::MutableTree::new();
repo.write_directory_to_mtree(&gfile, &mtree, None, None)?;
Ok(mtree)
}
fn commit_mtree(
- repo: &libostree::Repo,
- mtree: &libostree::MutableTree,
+ repo: &ostree::Repo,
+ mtree: &ostree::MutableTree,
) -> Result<String, glib::Error> {
repo.prepare_transaction(None)?;
let repo_file = repo.write_mtree(mtree, None)?.downcast().unwrap();
Ok(checksum)
}
-fn open_repo(repodir: &tempfile::TempDir) -> Result<libostree::Repo, glib::Error> {
- let repo = libostree::Repo::new_for_path(repodir.path());
+fn open_repo(repodir: &tempfile::TempDir) -> Result<ostree::Repo, glib::Error> {
+ let repo = ostree::Repo::new_for_path(repodir.path());
repo.open(None)?;
Ok(repo)
}